<extend name="common:commonNewerTemplate" />
<block name="main_content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="index.html"
				data-original-title="Go to Home"><i class="icon-home"></i> 首页</a> <a
				href="#">经销商</a> <a class="current" href="#">更新经销商信息</a>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-info-sign"></i>
						</span>
						<h5>经销商更新</h5>
					</div>
					<div class="widget-content nopadding">
						<form novalidate="novalidate" id="basic_validate"
							name="basic_validate" action="updateDealerAction" enctype="multipart/form-data" method="post"
							class="form-horizontal">
							<div class="control-group">
								<label class="control-label">经销商编号:</label>
								<div class="controls">
									<input type="text" id="dealer_id" value="{$dealer_en.dealer_id}"
										name="dealer_id" readonly="readonly" /><span style="color:red;">*</span>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">经销商名称:</label>
								<div class="controls">
									<input type="text" id="dealer_name" name="dealer_name" value="{$dealer_en.dealer_name}"/><span style="color:red;">*</span>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">经销商类型：</label>
								<div class="controls">
								<select id="dealer_type" name="dealer_type" style="width:220px;" >
								 <if condition="$dealer_en.dealer_type eq '1'">								
										<option value="1" selected="selected">一般纳税人</option>										
								   <else/>								 
										<option value="1">一般纳税人</option>										
								</if>
													
								 <if condition="$dealer_en.dealer_type eq '2'">										
										<option value="2" selected="selected">个体工商户</option>										
								   <else/>								   
										<option value="2">个体工商户</option>												
								</if>
									
															
								</select><span style="color:red;">*</span>
								</div>
							</div>
								<div class="control-group">
								<label class="control-label">用户编号:</label>
								<div class="controls">
									<input type="text" id="user_id_fk" name="user_id_fk" value="{$dealer_en.user_id}" readonly="readonly"/><span style="color:red;">*</span>
								</div>
							</div>
								
								<div class="control-group">
								<label class="control-label">金蝶唯一编码:</label>
								<div class="controls">
									<input type="text" id="k3_code" name="k3_code" value="{$dealer_en.k3_code}"/>
								</div>
							    </div>
								
								<div class="control-group">
								<label class="control-label">经销商默认返点:</label>
								<div class="controls">
									<input type="text" id="discount_rate" name="discount_rate" value="{$dealer_en.discount_rate}"/><span style="color:red;">*</span>
								</div>
							    </div>
							
						 	<div class="control-group">
								<label class="control-label">经销商后返点:</label>
								<div class="controls">
									<input type="text" id="cash_back_rate" name="cash_back_rate" value="{$dealer_en.cash_back_rate}"/><span style="color:red;">*</span>
								</div>
							    </div>
							<div class="control-group">
								<label class="control-label">业务对接人:</label>
								<div class="controls">
									<input type="text" id="business_leader" name="business_leader" value="{$dealer_en.business_leader}"/><span style="color:red;">*</span>
								</div>
							 </div>
							 
							 <div class="control-group">
								<label class="control-label">业务对接人电话:</label>
								<div class="controls">
									<input type="text" id="business_leader_cellphone" name="business_leader_cellphone" value="{$dealer_en.business_leader_cellphone}"/><span style="color:red;">*</span>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">大区:</label>
								<div class="controls">
									<input type="text" id="area_name" name="area_name" value="{$dealer_en.area_name}"/><span style="color:red;">*</span>
								</div>
							 </div>
							  <div class="control-group">
                                    <label class="control-label">省市区</label>
                                    <input type="hidden" id="temp_province" name="province_name" value="{$dealer_en.province_id}">
                                    <input type="hidden" id="temp_city" name="city_name" value="{$dealer_en.city_id}">
                                   

                                    <div class="controls">
                                        <select id="ssl_province" name="province_id" style="width:240px;">
                                        </select>


                                        <select id="ssl_city" name="city_id" style="width:240px;">
                                        </select><span style="color:red;">*</span>

                                   
                                    </div>
                                </div>
							 <div class="control-group">
								<label class="control-label">操作模式:</label>
								<div class="controls">
									<input type="text" id="operation_pattern" name="operation_pattern" value="{$dealer_en.operation_pattern}"/><span style="color:red;">*</span>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">注册资金:</label>
								<div class="controls">
									<input type="text" id="registered_capital" name="registered_capital" value="{$dealer_en.registered_capital}"/><span style="color:red;">*</span>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">法人代表:</label>
								<div class="controls">
									<input type="text" id="leal_person" name="leal_person" value="{$dealer_en.leal_person}"/><span style="color:red;">*</span>
								</div>
							 </div><div class="control-group">
								<label class="control-label">开户银行名称:</label>
								<div class="controls">
									<input type="text" id="bank_name" name="bank_name" value="{$dealer_en.bank_name}"/><span style="color:red;">*</span>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">开户银行账户:</label>
								<div class="controls">
									<input type="text" id="bank_no" name="bank_no" value="{$dealer_en.bank_no}"/><span style="color:red;">*</span>
								</div>
							 </div>
							<div class="control-group">
								<label class="control-label">税号:</label>
								<div class="controls">
									<input type="text" id="tax_no" name="tax_no" value="{$dealer_en.tax_no}"/><span style="color:red;">*</span>
								</div>
							 </div>
							  <div class="control-group">
								<label class="control-label">身份证号码:</label>
								<div class="controls">
									<input type="text" id="dealer_id_card_no" name="dealer_id_card_no" value="{$dealer_en.dealer_id_card_no}"/><span style="color:red;">*</span>
								    <input type="hidden" id="dealer_id_card_image_list" name="dealer_id_card_image_list" value="{$dealer_en.dealer_id_card_image_list}"/>
								</div>
							 </div>
							 
							 <div class="control-group">
								<label class="control-label">身份证图片正面:</label>
								<div class="controls">
									<a target="_blank" href="{$dealer_en.id_1}"> <img src="{$dealer_en.id_1}" alt="身份证正面面图片" width="220px;"></img></a>
								</div>
								<div class="controls">
									<input type="file" id="dealer_id_card_image_list1" name="dealer_id_card_image_list1" accept="image/gif,image/jpeg,image/png,image/jpg"/>
								</div>
							 </div>
							 
							 <div class="control-group">
								<label class="control-label">身份证图片反面:</label>
								<div class="controls">
								<a target="_blank" href="{$dealer_en.id_2}"> <img src="{$dealer_en.id_2}" alt="身份证反面图片" width="220px;"></img></a>
									
								</div>
								<div class="controls">
									<input type="file" id="dealer_id_card_image_list2" name="dealer_id_card_image_list2" accept="image/gif,image/jpeg,image/png,image/jpg"/>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">营业执照号码:</label>
								<div class="controls">
									<input type="text" id="business_license_no" name="business_license_no" value="{$dealer_en.business_license_no}"/><span style="color:red;">*</span>
									 <input type="hidden" id="business_license_image" name="business_license_image" value="{$dealer_en.business_license_image}"/>
								</div>
							 </div>
							 
							 <div class="control-group">
								<label class="control-label">营业执照图片:</label>
								<div class="controls">
									
									<a target="_blank" href="{$dealer_en.id_3}"> <img src="{$dealer_en.id_3}" alt="营业执照照片" width="220px;"></img></a>
								</div>
								<div class="controls">
									<input type="file" id="business_license_image1" name="business_license_image1" accept="image/gif,image/jpeg,image/png,image/jpg"/>
								</div>
							 </div>
							 
							 
							 <div class="control-group">
								<label class="control-label">组织机构图片:</label>
								<div class="controls">
									
									<a target="_blank" href="{$dealer_en.id_4}"> <img src="{$dealer_en.id_4}" alt="组织机构照片" width="220px;"></img></a>
								</div>
								<div class="controls">
									<input type="file" id="organization_image1" name="organization_image1" accept="image/gif,image/jpeg,image/png,image/jpg"/>
								</div>
							 </div>
							 
							 
							 <div class="control-group">
								<label class="control-label">税务登记图片:</label>
								<div class="controls">
									
									<a target="_blank" href="{$dealer_en.id_5}"> <img src="{$dealer_en.id_5}" alt="税务登记照片" width="220px;"></img></a>
								</div>
								<div class="controls">
									<input type="file" id="tax_registration_image1" name="tax_registration_image1" accept="image/gif,image/jpeg,image/png,image/jpg"/>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">一般纳税人图片:</label>
								<div class="controls">
									
									<a target="_blank" href="{$dealer_en.id_6}"> <img src="{$dealer_en.id_6}" alt="一般纳税人照片" width="220px;"></img></a>
								</div>
								<div class="controls">
									<input type="file" id="general_taxpayer_image1" name="general_taxpayer_image1" accept="image/gif,image/jpeg,image/png,image/jpg"/>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">开户许可证图片:</label>
								<div class="controls">
									
									<a target="_blank" href="{$dealer_en.id_7}"> <img src="{$dealer_en.id_7}" alt="开户许可证照片" width="220px;"></img></a>
								</div>
								<div class="controls">
									<input type="file" id="account_opening_image1" name="account_opening_image1" accept="image/gif,image/jpeg,image/png,image/jpg"/>
								</div>
							 </div>
							 
							 <div class="control-group">
								<label class="control-label">财务联系人:</label>
								<div class="controls">
									<input type="text" id="finance_leader" name="finance_leader" value="{$dealer_en.finance_leader}"/><span style="color:red;">*</span>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">财务联系人电话:</label>
								<div class="controls">
									<input type="text" id="finance_leader_cellphone" name="finance_leader_cellphone" value="{$dealer_en.finance_leader_cellphone}"/><span style="color:red;">*</span>
								</div>
							 </div><div class="control-group">
								<label class="control-label">发票寄送地址:</label>
								<div class="controls">
									<input type="text" id="invoice_address" name="invoice_address" value="{$dealer_en.invoice_address}"/><span style="color:red;">*</span>
								</div>
							 </div>
							 
							 <div class="control-group">
								<label class="control-label">税务注册地址:</label>
								<div class="controls">
									<input type="text" id="registered_address" name="registered_address" value="{$dealer_en.registered_address}"/>
								</div>
							 </div>
							 <div class="control-group">
								<label class="control-label">税务注册电话:</label>
								<div class="controls">
									<input type="text" id="registered_tel" name="registered_tel" value="{$dealer_en.registered_tel}"/>
								</div>
							 </div>
							 <!-- <div class="control-group">
								<label class="control-label">所有进货数量:</label>
								<div class="controls">
									<input type="text" id="buy_count" name="required" value="{$dealer_en.buy_count}"/>
								</div>
							 </div>
							   <div class="control-group">
								<label class="control-label">首次购买时间:</label>
								<div class="controls">
									<input id="first_buy_date"  value="{$dealer_en.first_buy_date}" style="background-color: #fff;border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;width:217px;color:#555;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
								</div>
							</div> 
							<div class="control-group">
								<label class="control-label">最后一次购买时间:</label>
								<div class="controls">
									<input id="last_buy_date"  value="{$dealer_en.last_buy_date}" style="background-color: #fff;border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;width:217px;color:#555;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
								</div>
							</div>  -->
							<div class="control-group">
								<label class="control-label">备注:</label>
								<div class="controls">
									<input type="text" id="remark" name="remark" value="{$dealer_en.remark}"/>
								</div>
							</div>
							<!-- <div class="control-group">
								<label class="control-label">余额:</label>
								<div class="controls">
									<input type="text" id="amount" name="required" value="{$dealer_en.amount}"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">积分:</label>
								<div class="controls">
									<input type="text" id="points" name="required" value="{$dealer_en.points}"/>
								</div>
							</div> -->
							<div class="control-group">
								<label class="control-label">签约状态:</label>
								<div class="controls">
									<select id="sign_status" name="sign_status" style="width:220px;">
									<if condition="$dealer_en.sign_status eq '1'">
									<option value="1" selected="selected">待签约</option>
									<else/>
									 <option value="1">待签约</option>
									</if>
									<if condition="$dealer_en.sign_status eq '2'">
									<option value="2" selected="selected">经销商待盖章</option>
									<else/>
									 <option value="2">经销商待盖章</option>
									</if>
									<if condition="$dealer_en.sign_status eq '3'">
									<option value="3" selected="selected">已签约</option>
									<else/>
									 <option value="3">已签约</option>
									</if>    
					                 
					                </select><span style="color:red;">*</span>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">签约时间:</label>
								<div class="controls">
									<input id="sign_date" value="{$dealer_en.sign_date}" style="background-color: #fff;border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;width:217px;color:#555;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
								</div>
							</div> 
							<div class="control-group">
								<label class="control-label">合同签约起始日期:</label>
								<div class="controls">
									<input id="contract_start_date" value="{$dealer_en.contract_start_date}" style="background-color: #fff;border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;width:217px;color:#555;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
								</div>
							</div> 
							<div class="control-group">
								<label class="control-label">合同签约结束日期:</label>
								<div class="controls">
									<input id="contract_end_date" value="{$dealer_en.contract_end_date}" style="background-color: #fff;border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;width:217px;color:#555;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
								</div>
							</div> 
							<!-- <div class="control-group">
								<label class="control-label">注册日期:</label>
								<div class="controls">
									<input id="register_date" value="{$dealer_en.register_date}" style="background-color: #fff;border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;width:217px;color:#555;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
								</div>
							</div> 
							<div class="control-group">
								<label class="control-label">注册时IP:</label>
								<div class="controls">
									<input type="text" id="register_ip" name="required" value="{$dealer_en.register_ip}"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">最后登录时间:</label>
								<div class="controls">
									<input id="last_login_date" value="{$dealer_en.last_login_date}" style="background-color: #fff;border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;width:217px;color:#555;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
								</div>
							</div> 
							<div class="control-group">
								<label class="control-label">最后登录时IP:</label>
								<div class="controls">
									<input type="text" id="last_login_ip" name="required" value="{$dealer_en.last_login_ip}"/>
								</div>
							</div>
							 -->
							<!-- <div class="control-group">
								<label class="control-label">状态:</label>
								<div class="controls">
									<select id="status"  name="status" style="width:220px;">
					                 <if condition="$dealer_en.status eq '0'">
									<option value="1" selected="selected">待审核</option>
									<else/>
									<option value="1">待审核</option>
									</if>
									<if condition="$dealer_en.status eq '1'">
									<option value="2" selected="selected">已审核</option>
									<else/>
									<option value="2">已审核</option>
									</if>
									<if condition="$dealer_en.status eq '1'">
									<option value="3" selected="selected">审核失败</option>
									<else/>
									<option value="3">审核失败</option>
									</if>
					                </select>
								</div>
							</div> -->
							<div class="control-group">
								<a id="btn_updateDealer" class="btn btn-success">更新经销商</a> 
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

</block>


<block name="js_content">
<script src="/Public/js/laydate/laydate.js" type="text/javascript"></script> 

 <script>
		//新增页面资源管理
		$('#btn_updateDealer').bind('click', function(){
			var province_name = $('#ssl_province').find("option:selected").text();		
			var city_name = $('#ssl_city').find("option:selected").text();
			
			$('#temp_province').val(province_name);
			$('#temp_city').val(city_name);
			
			var condition = $('#basic_validate').serialize();
			
			
			 $.ajax({
	                type: 'post',
	                url: '/AjaxService/center/dealer/validateDealer',
	                data: condition,
	                dataType: 'json',
	                async: false,
	                success: function (data) {
	                    if (data.IsSuccess == 0) {
	                        alert(data.ErrorMsg);
	                        return;
	                    } else {
	                       $('#basic_validate').submit();
	                       //alert("Finished");
	                    }
	                },
	                error: function (e, err_name, err_text) {

	                }
	            });
		});
		
		$(document).ready(function () {
		    CommonPage.InitRegion();
		  

		    //设置省市区
		    if($("#temp_province").val()){
		        $('#ssl_province').val($("#temp_province").val());
		        $('#ssl_province').trigger('change');
		    }
		    if($("#temp_city").val()){
		        $('#ssl_city').val($("#temp_city").val());
		        $('#ssl_city').trigger('change');
		    }
		    
		});
</script> </block>